package com.archgeek.rpc.pekko.remote;

import com.typesafe.config.Config;
import com.typesafe.config.ConfigFactory;
import org.apache.pekko.actor.AbstractActor;
import org.apache.pekko.actor.ActorRef;
import org.apache.pekko.actor.ActorSystem;
import org.apache.pekko.actor.Props;
import org.apache.pekko.japi.pf.ReceiveBuilder;

/**
 * @author pizhihui
 * @date 2024-05-23 09:10
 */
public class SystemClient {


    public static void main(String[] args) {


        Config config = ConfigFactory.load();
        ActorSystem actorSystem = ActorSystem.create("actor-client-system", config);


        ActorRef clientActor = actorSystem.actorOf(Props.create(SystemClientActor.class), "client-actor");

        // clientActor.tell(new HEvent(), get);


    }

}

class SystemClientActor extends AbstractActor {

    @Override
    public Receive createReceive() {
        return ReceiveBuilder.create()
                .match(HEvent.class, this::handleEvent)
                .build();
    }

    public void handleEvent(HEvent hEvent) {
        System.out.println("");
    }
}
